//
//  Constants.h
//  iFly
//
//  Created by User-10 on 12/6/14.
//  Copyright (c) 2014 TeamDifferent. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <SpriteKit/SpriteKit.h>

//social type definition
typedef enum {
    Facebook,
    Twitter
} SocialType;

static const uint32_t characterCategory =  0x1 << 0;
static const uint32_t obstacleCategory =  0x1 << 1;
static const uint32_t shieldCategory =  0x1 << 2;
static const uint32_t weaponsCategory =  0x1 << 3;
static const uint32_t bonusCategory = 0x1 << 4;

static const uint32_t deadCategory = 0x1 << 10;

static NSString* ironManForward = @"ironManFly.png";
static NSString* ironManForwardLeftShoot = @"ironManShootLeftNew.png";
static NSString* ironManForwardRightShoot = @"ironManShootRightNew.png";
static NSString* ironManBack = @"ironManBack.png";
static NSString* ironManBackLeftShoot = @"ironManBackShooting.png";
static NSString* ironManBackRightShoot = @"ironManBackRightShoot.png";
static NSString* ironManParts = @"ironManParts.png";
static NSString* ironManShieldState = @"ironManShieldState.png";

//shield pictures
static NSString* kImageNameForShieldBaseImage = @"shield";

static NSString* pauseButtonImage=@"PauseButton.png";
static NSString* playButtonImage =@"PlayButtonImage.png";
static NSString* closeButtonName=@"xButton";

static NSString* shieldButtonImage = @"BlueShieldButton.png";
static NSString* fireButtonImage = @"FireButton.png";

//gameScene constants
static const NSInteger kLevelTime = 60;

//character constants
static const NSInteger characterLives = 3;
static const NSInteger numberOfShieldImages = 6;
static const NSInteger smokeEmitterStepIncrease = 25;
static const NSInteger kShieldDuration = 3;
static const NSInteger kShieldCooldown = 10;
static const NSInteger kShieldYPosition = 15;

//enemy character constants
static const NSInteger minY = 100;
static const NSInteger enemyCharacterHealth = 50;
static const NSInteger enemyCharacterHealthTreshold = 3;
static const NSInteger chanceForEnergyBall = 40;
static const NSInteger flyingInOffset = 200;

//enemy and bonuses random position constants
static const NSInteger spawningRange = 50;
static const NSInteger spawningOffset = 25;

//enemy speed constants
static const NSInteger missileMinSpeed = 3;
static const NSInteger missileMaxSpeed = 6;
static const NSInteger shipMinSpeed = 4;
static const NSInteger shipMaxSpeed = 7;

static const NSInteger numberOfEnemyTypes = 2;
typedef NS_ENUM(NSUInteger, EnemyType) {
    EnemyTypeMissile = 0,
    EnemyTypeShip = 1
};

static const NSInteger numberOfProjectileTypes = 2;
typedef NS_ENUM(NSUInteger, ProjectileType) {
    ProjectileTypeLaser = 0,
    ProjectileTypeTripleLaser = 1
};

//triple laser constants
static const NSInteger upLaserX = 500;
static const NSInteger upLaserY = 100;
static const NSInteger kTripleLaserDuration = 10;

static const NSInteger numberOfBonusTypes = 2;
typedef NS_ENUM(NSUInteger, BonusType) {
    BonusTypeCoin = 0,
    BonusTypeHeal = 1
};

//bonus chance constants
static const NSInteger chanceForHeal = 5;
static const NSInteger chanceForTripleLaser = 3;

//score logic constanst
static const NSInteger missileHealth = 1;
static const NSInteger missilePointsForKill = 2;
static const NSInteger shipHealth = 2;
static const NSInteger shipPointsForKill = 3;
static const NSUInteger coinPoints=1;
static const NSInteger lokiPointsForKill = 150;

//background positions
static const NSInteger moonPosition = 36;

//main menu constants
static NSInteger retreatRightBorder = 160;
static NSInteger ironManPicWidthRetreat = 7;
static const float ironManPicHeightRetreat = 4.6;
static NSString* logoLabelName = @"iFly";
static NSString* playLabelName = @"Play";
static NSString* highScoreLabelName = @"Leaderboard";
static NSString* shopLabelName = @"Shop";
static NSString* labelFontName = @"Chalkduster";
static NSString* mainMenuLabelName= @"Main";
static NSString* kImageNameForIronBaseImage = @"ironManMasked";
static NSInteger numberOfIronPicImages = 2;

//tutorial constants
static NSString* tutorialLabelName = @"Tutorial";
static const CGFloat MarginPercent = 0.013;
static const CGFloat backMenuLabelScale = 0.03;
static const NSInteger characterXPosition = 120;
static const CGFloat joystickHeightScale = 0.7;
static const CGFloat textHeightScale = 0.5;
static const CGFloat picsScale = 1.8;
static const CGFloat bonusLabelHeightScale = 1.3;
static const CGFloat bonusPicHeightScale = 1.1;
static const CGFloat healLabelHeightScale = 2.8;
static const CGFloat healPicHeightScale = 2.3;
static const CGFloat shipPicHeightScale = 1.2;
static const CGFloat rocketPicHeightScale = 1.8;

//leaderboard constants
static const float leaderIronManHeightOffset = 1.8;
static NSString* backLabelName = @"BackLabel";
static const float fontSizeOffset = 0.06;


//game over scene constants
static NSUInteger kTextFieldWidth = 300;
static NSUInteger kTextFieldHeight = 40;
static NSString*  gameOverSceneTextFieldPlaceholder= @"Enter your name here";

//Sounds
static NSString* gameOverSound=@"GameOver";
static NSString* winningSound=@"winningSceneMusic";
static NSString* mainMenuSound=@"mainMenuSound";
static NSString* flyBySound=@"FlyBySound";

static NSString* gameOverExplosionSound =@"explosion_large";
static NSString* fireSound=@"laser_enemy";
static NSString* smallExplosionSound=@"explosion_small";
static NSString* backgroundSound=@"background-music-aac";



//scaling constants
static const float sceneScaling = 800;
static const float pauseButtonScaling=0.2;
static const float fireButtonScaling=0.4;
static const NSUInteger mediumScreenSizeInHeight= 640;
static const float joystickScalling= 1.5;
static const float shieldScaling = 3.0;
static const float missileScaling = 2.75;
static const float coinScaling = 2.0;
static const float fireballScaling = 2.5;
static const float handForwardShootWidthScaling = 120;
static const float handForwardShootHeightScaling = 42;
static const float handBackwardsShootWidthScaling = 110;
static const float handBackwardsShootHeightScaling = 70;
static const float characterPhyisicsBodyScaling = 1.11;


// offsets
static const NSInteger outOfScreenOffset = 3000;
static const NSUInteger pauseButtonOffset=40;
static const NSUInteger buttonsOffset=40;
static const NSUInteger fireButtonOffset=80;
static const NSUInteger joystickOffset= 100;
static const NSUInteger shieldButtonOffset = 20;


//core data constants
static const NSInteger numberOfHighScores = 10;

//label message constants
static  NSString* gameOverText=@"Game Over";
static  NSString* winningText=@"You win";


@interface Constants : NSObject

+ (SKLabelNode *) createLabelWithFont:(NSString *)font text:(NSString *)text fontColor:(SKColor *)color fontSize:(NSInteger)fontSize;
+ (SKSpriteNode *) createSpriteNodeWithImage:(NSString*) imageName andName:(NSString*) nodeName andPosition:(CGPoint) nodePosition andAlpha:(CGFloat) alpha andScale:(CGFloat) scale;
@end
